package cn.silver.framework.core.config;

import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;

import java.io.File;

/**
 * 读取项目相关配置
 *
 * @author Lion Li
 */

@Data
@Component
@ConfigurationProperties(prefix = "silver")
public class SilverConfig {
    /**
     * 项目名称
     */
    private String name;

    private String author;
    /**
     * 版本
     */
    private String version;

    private String description;
    /**
     * 版权年份
     */
    private String copyrightYear;
    private boolean demoEnabled;
    private boolean addressEnabled;

    /**
     * 缓存懒加载
     */
    private boolean cacheLazy;
    private String webUrl;
    private String trustUrl;
    private String profile;

    public String getTempfilePath() {
        return this.profile + File.separator + "temp";
    }

    public String getAvatarPath() {
        return this.profile + File.separator + this.getAvatar();
    }

    public String getAvatar() {
        return "avatar";
    }

}
